<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function clone(target) {
      let cloneTarget = {};
      for(key in target) {
        cloneTarget[key] = target[key]
      }
      return cloneTarget
    }
    const target = {
      field1: 1,
      field2: undefined,
      field3: 'ConardLi',
      field4: {
        child: 'child',
        child2: {
          child2: 'child2'
        }
      },
      field5: [1, 2]
    };
    const result = clone(target)
    console.log(result);
    target.name = "wjf"
    console.log(target);
  </script>
</body>
</html>